﻿<Window x:Class="Cradiator.Views.MessageWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        WindowStyle="None"
        SizeToContent="WidthAndHeight" 
        WindowStartupLocation="CenterScreen"
        AllowsTransparency="True"
        ShowInTaskbar="False" 
        Background="Transparent"
        Topmost="True">

    <Window.Resources>
        <Storyboard x:Key="FadeIn">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                           Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value=".7"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <!-- used in C#-->
        <Storyboard x:Key="FadeAway">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" 
                 Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>

    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource FadeIn}"/>
        </EventTrigger>
    </Window.Triggers>

    <Border x:Name="Container" CornerRadius="8" Background="Black">
        <TextBlock x:Name="Message" Foreground="White" Width="Auto" TextAlignment="Center" FontSize="48" Padding="10" />
    </Border>

</Window>
